// 5.12 Computing Averages Using a for Loop

#include <stdio.h>
#define MAXCOUNT 4
int main() 
{
    int count;
    float num,total,average;

    printf("\nThis program will ask you to enter %d numbers.\n\n",MAXCOUNT);
    
    total=0.0;

    for(count=0;count<MAXCOUNT;count++)
    {
        printf("Enter a number: ");
        scanf("%f",&num);
        total+=num;
    }

    average=total/MAXCOUNT;
    printf("\nThe average of the %d numbers is %8.4f\n",MAXCOUNT,average);
    
    return 0;
}